import axios from "@/tool/axios";
export const getgoods = (obj) => axios.get("goods", {
    params: obj
})

export const categories = (obj={}) => axios.get("categories",{
    params:obj
})

export const addcategories = (obj) => axios.post("categories",obj)

// 获取商品分类数据列表
export const hqgoods = (obj) => axios.get("categories",{
    params:obj
})

// 添加分类
export const addgoods = (obj) => axios.post("categories",obj)

//商品分类参数（静态，动态）
export const getCategorieslist = (id, sel = "many") => axios.get(`categories/${id}/attributes`,{
    params:{sel}
})

// 参数列表
export const categoriesAttributes = (id,obj) => axios.get(`categories/${id}/attributes`,{
    params:obj
})

// 编辑提交参数
export const editCategoriesAttributes = (id,attrId,obj) => axios.put(`categories/${id}/attributes/${attrId}`,obj)

// 添加动态参数或者静态属性
export const addAttributes = (id,obj) => axios.post(`categories/${id}/attributes`,obj)